// wait_group 实现有条件的等待
#include <workflow/WFFacilities.h>
#include <workflow/WFTaskFactory.h>
#include <iostream>
#include <signal.h>
using std::cout;
using std::cerr;
static WFFacilities::WaitGroup waitGroup(1);
void handler(int signum){
    cout << "done\n";
    waitGroup.done();
}
int main(){
    signal(SIGINT,handler);
    // 创建任务
    WFRedisTask * redisTask =  WFTaskFactory::create_redis_task(
        "redis://127.0.0.1:6379",
        10,
        nullptr
    );
    // 找到请求
    protocol::RedisRequest * req =  redisTask->get_req();
    req->set_request("SET", {"key", "value"});

    // 将任务交给框架
    redisTask->start();
    waitGroup.wait();
    cout << "finish!\n";
}
